<?php

namespace App\Http\Controllers\Api;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use EasyWeChat\Foundation\Application;


class ServerValidateController extends Controller
{
    //
    public function index()
    {
        $options = [
            'debug'  => true,
            'app_id' => 'wx47cebab9f8c406ee',
            'secret' => '499cc02f42b7d5f0ba0f43dd32b6bc7f',
            'token'  => 'd0HS9YuJ9p8pAuH8DmJ0M8Dpd0zHUP0Y',

            // 'aes_key' => null, // 可选

            'log' => [
                'level' => 'debug',
                'file'  => '/tmp/easywechat.log', // XXX: 绝对路径！！！！
            ],

            //...
        ];

        $app = new Application($options);

        $response = $app->server->serve();
        dd($response);
        // 将响应输出
        return $response;// Laravel 里请使用：return $response;
    }
}
